<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./Template/templateClient.xhtml"
                xmlns:p="http://primefaces.org/ui"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core">
    
    
    <ui:define name="content">
        <f:metadata>
            <f:viewParam name="nodeId" value="#{contentBean.nodeId}" />
        </f:metadata>
        
        <h1>#{bundle.ajouter_contenu}</h1>
        <div>
            <p:tabView effect="fade" effectDuration="normal">  
  
                <p:tab title="#{bundle.legende}">
                    
                    <h:form>
                        <p:growl id="legend-error" autoUpdate="false" showDetail="false" sticky="false"/>    
                        <h:panelGrid columns="2" cellpadding="10">

                            <h:outputLabel value="#{bundle.description} : " />
                            <p:inputTextarea value="#{contentBean.descr}" rows="5" cols="50" required="true" requiredMessage="#{bundle.erreur_descr_no}"/>

                            <h:outputLabel value="#{bundle.photo} : "/> 
                            <p:fileUpload value="#{contentBean.photo}"
                                label="#{bundle.photo}"
                                uploadLabel="#{bundle.valider}"
                                cancelLabel="#{bundle.annuler}"
                                sizeLimit="1000000"   
                                allowTypes="/(\.|\/)(gif|jpe?g|png)$/" 
                                required="true"
                                requiredMessage="#{bundle.erreur_image_no}"/>

                            <h:outputLabel value="#{bundle.latitude} : "/>
                            <p:inputText value="#{contentBean.latitude}" />

                            <h:outputLabel value="#{bundle.longitude} : "/>
                            <p:inputText value="#{contentBean.longitude}"/>

                            <h:outputLabel value="#{bundle.rue} : "/>
                            <p:inputText value="#{contentBean.rue}"/>

                            <h:outputLabel value="#{bundle.code_postal} : "/>
                            <p:inputText value="#{contentBean.codePostal}"/>

                            <h:outputLabel value="#{bundle.ville} : "/>
                            <p:inputText value="#{contentBean.ville}" required="true" requiredMessage="#{bundle.erreur_ville_no}"/>

                            <h:outputLabel value="#{bundle.historique} : " />
                            <p:inputTextarea value="#{contentBean.historique}" rows="5" cols="50"/>

                            <h:outputLabel value="#{bundle.site_web} : "/>
                            <p:inputText value="#{contentBean.siteWeb}"/>

                            <p:commandButton update="legend-error" value="#{bundle.valider}" icon="ui-icon-check" actionListener="#{contentBean.save()}"/>
                    
                        </h:panelGrid>
                    </h:form>
                </p:tab>

                <p:tab title="#{bundle.lieu}">
                    <h:form>
                        <p:growl id="lieu-error" autoUpdate="false" showDetail="false" sticky="false"/>
                        <h:panelGrid columns="2" cellpadding="10">
                            
                            <h:outputLabel value="#{bundle.description} : " />
                            <p:inputTextarea value="#{contentBean.descr}" rows="5" cols="50" required="true" requiredMessage="#{bundle.erreur_descr_no}"/>
                            
                            <h:outputLabel value="#{bundle.photo} : "/> 
                            <p:fileUpload value="#{contentBean.photo}"
                                label="#{bundle.photo}"
                                uploadLabel="#{bundle.valider}"
                                cancelLabel="#{bundle.annuler}"
                                sizeLimit="1000000"   
                                allowTypes="/(\.|\/)(gif|jpe?g|png)$/" 
                                required="true"
                                requiredMessage="#{bundle.erreur_image_no}" />

                            <h:outputLabel value="#{bundle.latitude} : "/>
                            <p:inputText value="#{contentBean.latitude}" />

                            <h:outputLabel value="#{bundle.longitude} : "/>
                            <p:inputText value="#{contentBean.longitude}"/>

                            <h:outputLabel value="#{bundle.rue} : "/>
                            <p:inputText value="#{contentBean.rue}"/>

                            <h:outputLabel value="#{bundle.code_postal} : "/>
                            <p:inputText value="#{contentBean.codePostal}"/>

                            <h:outputLabel value="#{bundle.ville} : "/>
                            <p:inputText value="#{contentBean.ville}" required="true" requiredMessage="#{bundle.erreur_ville_no}"/>

                            <h:outputLabel value="#{bundle.historique} : " />
                            <p:inputTextarea value="#{contentBean.historique}" rows="5" cols="50" />

                            <h:outputLabel value="#{bundle.site_web} : "/>
                            <p:inputText value="#{contentBean.siteWeb}"/>

                            <p:commandButton update="lieu-error" value="#{bundle.valider}" icon="ui-icon-check" actionListener="#{contentBean.save()}"/>
                    
                        </h:panelGrid>
                    </h:form>
                </p:tab>  

                <p:tab title="#{bundle.monument}">  
                    <h:form>
                        <p:growl id="monument-error" autoUpdate="false" showDetail="false" sticky="false"/>
                        <h:panelGrid columns="2" cellpadding="10">

                            <h:outputLabel value="#{bundle.description} : " />
                            <p:inputTextarea value="#{contentBean.descr}" rows="5" cols="50"/>
                            
                            <h:outputLabel value="#{bundle.photo} : "/> 
                            <p:fileUpload value="#{contentBean.photo}"
                                label="#{bundle.photo}"
                                uploadLabel="#{bundle.valider}"
                                cancelLabel="#{bundle.annuler}"
                                sizeLimit="1000000"   
                                allowTypes="/(\.|\/)(gif|jpe?g|png)$/" 
                                required="true" 
                                requiredMessage="#{bundle.erreur_image_no}"/>

                            <h:outputLabel value="#{bundle.latitude} : "/>
                            <p:inputText value="#{contentBean.latitude}" />

                            <h:outputLabel value="#{bundle.longitude} : "/>
                            <p:inputText value="#{contentBean.longitude}"/>

                            <h:outputLabel value="#{bundle.historique} : " />
                            <p:inputTextarea value="#{contentBean.historique}" rows="5" cols="50" required="true" requiredMessage="#{bundle.erreur_historique_no}"/>

                            <h:outputLabel value="#{bundle.site_web} : "/>
                            <p:inputText value="#{contentBean.siteWeb}"/>

                            <p:commandButton update="monument-error" value="#{bundle.valider}" icon="ui-icon-check" actionListener="#{contentBean.save()}"/>
                    
                        </h:panelGrid>
                    </h:form>
                </p:tab>

                <p:tab title="#{bundle.restaurant}">  
                    <h:form>
                        <p:growl id="restaurant-error" autoUpdate="false"  showDetail="false" sticky="false"/>
                        <h:panelGrid columns="2" cellpadding="10">

                            <h:outputLabel value="#{bundle.description} : " />
                            <p:inputTextarea value="#{contentBean.descr}" rows="5" cols="50" required="true" requiredMessage="#{bundle.erreur_descr_no}"/>
                            
                            <h:outputLabel value="#{bundle.photo} : "/> 
                            <p:fileUpload value="#{contentBean.photo}"
                                label="#{bundle.photo}"
                                uploadLabel="#{bundle.valider}"
                                cancelLabel="#{bundle.annuler}"
                                sizeLimit="1000000"   
                                allowTypes="/(\.|\/)(gif|jpe?g|png)$/" 
                                required="true" 
                                requiredMessage="#{bundle.erreur_image_no}"/>
                            
                            <h:outputLabel value="#{bundle.video} - #{bundle.lien_youtube}: "/>
                            <p:inputText value="#{contentBean.video}" />

                            <h:outputLabel value="#{bundle.latitude} : "/>
                            <p:inputText value="#{contentBean.latitude}" />

                            <h:outputLabel value="#{bundle.longitude} : "/>
                            <p:inputText value="#{contentBean.longitude}"/>

                            <h:outputLabel value="#{bundle.rue} : "/>
                            <p:inputText value="#{contentBean.rue}" required="true" requiredMessage="#{bundle.erreur_rue_no}"/>

                            <h:outputLabel value="#{bundle.code_postal} : "/>
                            <p:inputText value="#{contentBean.codePostal}" required="true" requiredMessage="#{bundle.erreur_codepostal_no}"/>

                            <h:outputLabel value="#{bundle.ville} : "/>
                            <p:inputText value="#{contentBean.ville}" required="true"  requiredMessage="#{bundle.erreur_ville_no}"/>

                            <h:outputLabel value="#{bundle.site_web} : "/>
                            <p:inputText value="#{contentBean.siteWeb}"/>
                            
                            <h:outputLabel value="#{bundle.tel} : "/>
                            <p:inputText value="#{contentBean.tel}" required="true"  requiredMessage="#{bundle.erreur_tel_no}"/>

                            <p:commandButton update="restaurant-error" value="#{bundle.valider}" icon="ui-icon-check" actionListener="#{contentBean.save()}"/>
                    
                        </h:panelGrid>
                    </h:form>  
                </p:tab>  

            </p:tabView>
        </div>
    </ui:define>
</ui:composition>

